package cn.iocoder.an.module.mold.dal.mysql.recheckstatics;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.recheckstatics.RecheckStaticsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.recheckstatics.vo.*;

/**
 * 复检统计 Mapper
 *
 * @author ykk
 */
@Mapper
public interface RecheckStaticsMapper extends BaseMapperX<RecheckStaticsDO> {

    default PageResult<RecheckStaticsDO> selectPage(RecheckStaticsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecheckStaticsDO>()
                .eqIfPresent(RecheckStaticsDO::getAccountId, reqVO.getAccountId())
                .eqIfPresent(RecheckStaticsDO::getDrawingNoId, reqVO.getDrawingNoId())
                .eqIfPresent(RecheckStaticsDO::getRecheckId, reqVO.getRecheckId())
                .eqIfPresent(RecheckStaticsDO::getRecheckCounts, reqVO.getRecheckCounts())
                .betweenIfPresent(RecheckStaticsDO::getRecheckTotalTime, reqVO.getRecheckTotalTime())
                .eqIfPresent(RecheckStaticsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(RecheckStaticsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RecheckStaticsDO::getId));
    }

}